/* va_start example */
#include <stdio.h>
#include <stdarg.h>

void PrintFloats(int amount, ...)
{
  int i;
  double val;
  printf("Floats passed: ");
  va_list vl;
  va_start(vl, amount);
  for (i = 0; i < amount; i++) {
    val = va_arg(vl, double);
    printf("\t%.2f", val);
  }
  va_end(vl);
  printf("\n");
}

int main()
{
  PrintFloats(3, 3.14159, 2.71828, 1.41421);
  return 0;
}